package com.example.bootDemo.manyTomany;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 一对多发送者
 *
 * @author zys20
 */
@Component
public class ManyToManySender {

    @Autowired
    private AmqpTemplate rabbitmqTemplate;

    public void send(int i) {
        String context = "ManyToMany Spring Boot queue + " + " *********** " + i;
        System.out.println("Sender3 : " + context);
        this.rabbitmqTemplate.convertAndSend("manyToMany", context);
    }

}
